package com.bw.widget_sdk.decoration;

import android.content.Context;
import android.graphics.Color;

import androidx.annotation.Nullable;

import com.bw.widget_sdk.R;
import com.yanyusong.y_divideritemdecoration.Dp2Px;
import com.yanyusong.y_divideritemdecoration.Y_Divider;
import com.yanyusong.y_divideritemdecoration.Y_DividerBuilder;
import com.yanyusong.y_divideritemdecoration.Y_DividerItemDecoration;

public class HomeHotDecoration extends Y_DividerItemDecoration {

    private Context context;

    public HomeHotDecoration(Context context) {
        super(context);
        this.context = context;
    }

    @Nullable
    @Override
    public Y_Divider getDivider(int itemPosition) {
        Y_Divider divider = null;
        if (itemPosition == 0){
            //第0条数据也就是最左边数据不需要添加左侧间隔
            Y_DividerBuilder builder = new Y_DividerBuilder();
            divider = builder.create();
        }else {
            Y_DividerBuilder builder = new Y_DividerBuilder();
            builder.setLeftSideLine(true, Color.WHITE, Dp2Px.convert(context,5),0,0);
            divider = builder.create();
        }
        return divider;
    }
}
